/**
   Copyright 2012 Shakil Siraj (shakil.siraj@gmail.com)

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package com.googlecode.objectify.test.dataloader.example.bookstore;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.test.dataloader.example.BaseDatastoreEntity;

/**
 * @author Shakil Siraj (shakil.siraj@gmail.com)
 *
 */
@Entity
@Cache
public class Stock extends BaseDatastoreEntity {
    
    /**
     * Reference to the book by it's Key.
     */
    private Key<Book> book;
    
    /**
     * The price of the book in stock.
     */
    private Float price;
    
    /**
     * Reference to the sale record for this stock.
     */
    @Index
    private Key<SaleRecord> saleRecord;

    /**
     * Getter method for book
     * @return the book
     */
    public Key<Book> getBook() {
        return book;
    }

    /**
     * Setter method for book
     * @param book the book to set
     */
    public void setBook(Key<Book> book) {
        this.book = book;
    }

    /**
     * Getter method for price
     * @return the price
     */
    public Float getPrice() {
        return price;
    }

    /**
     * Setter method for price
     * @param price the price to set
     */
    public void setPrice(Float price) {
        this.price = price;
    }

    /**
     * Getter method for saleRecord
     * @return the saleRecord
     */
    public Key<SaleRecord> getSaleRecord() {
        return saleRecord;
    }

    /**
     * Setter method for saleRecord
     * @param saleRecord the saleRecord to set
     */
    public void setSaleRecord(Key<SaleRecord> saleRecord) {
        this.saleRecord = saleRecord;
    }
    
    

}
